//全选
function calculate(){
    //tb下有几个子元素
    var num=document.querySelectorAll("#check-box");
    var sum=0;

    for(var i=0;i<num.length;i++){
        let bool=document.querySelectorAll("#calculate")[0].checked;
        let n =document.querySelectorAll("#check-box")[i].children[1].value;
        let jiage =document.querySelectorAll("#check-box")[i].innerText;
        if(bool){
            sum+=parseFloat(jiage)*parseFloat(n);
        }
    }
    // document.getElementById("total").innerText=sum;

    var bool;
    var isTrue=0;
    var isFalse=0;
    for(var i=0;i<num.length;i++){
        //勾选状态
        bool=document.querySelectorAll("#tb th:nth-child(1)")[i].children[0];
        if(bool.checked==true){
            isTrue++;
        }else{
            isFalse++;
        }
    }
    console.log(isTrue);
    if(num.length==isTrue){
        document.getElementsByTagName("input")[1].checked=true;
    }else if(num.length!=isFalse){
        document.getElementsByTagName("input")[1].checked=false;
    }
}